using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._ChangeDetection
{
    /// <summary>
    /// <para>Analyze Changes Using CCDC</para>
    /// <para>Evaluates changes in pixel values over time using the Continuous Change Detection and Classification (CCDC) method and generates a change analysis raster containing the model results.</para>
    /// <para>使用连续变化检测和分类 （CCDC） 方法评估像素值随时间的变化，并生成包含模型结果的变化分析栅格。</para>
    /// </summary>    
    [DisplayName("Analyze Changes Using CCDC")]
    public class AnalyzeChangesUsingCCDC : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AnalyzeChangesUsingCCDC()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_multidimensional_raster">
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// </param>
        /// <param name="_out_ccdc_result">
        /// <para>Output CCDC Analysis Raster</para>
        /// <para><xdoc>
        ///   <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        ///   <para>The output change analysis raster containing model information from the CCDC analysis.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        ///   <para>包含来自 CCDC 分析的模型信息的输出变化分析栅格。</para>
        /// </xdoc></para>
        /// </param>
        public AnalyzeChangesUsingCCDC(object _in_multidimensional_raster, object _out_ccdc_result)
        {
            this._in_multidimensional_raster = _in_multidimensional_raster;
            this._out_ccdc_result = _out_ccdc_result;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Analyze Changes Using CCDC";

        public override string CallName => "ia.AnalyzeChangesUsingCCDC";

        public override List<string> AcceptEnvironments => ["cellSize", "compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_multidimensional_raster, _out_ccdc_result, _bands, _tmask_bands, _chi_squared_threshold, _min_anomaly_observations, _update_frequency];

        /// <summary>
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Multidimensional Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_multidimensional_raster { get; set; }


        /// <summary>
        /// <para>Output CCDC Analysis Raster</para>
        /// <para><xdoc>
        ///   <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        ///   <para>The output change analysis raster containing model information from the CCDC analysis.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        ///   <para>包含来自 CCDC 分析的模型信息的输出变化分析栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output CCDC Analysis Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_ccdc_result { get; set; }


        /// <summary>
        /// <para>Bands for Detecting Change</para>
        /// <para>The band IDs to use for change detection. If no band IDs are provided, all the bands from the input raster dataset will be used.</para>
        /// <para>用于更改检测的频段 ID。如果未提供波段 ID，则将使用输入栅格数据集中的所有波段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bands for Detecting Change")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _bands { get; set; } = null;


        /// <summary>
        /// <para>Bands for Temporal Masking</para>
        /// <para>The band IDs to be used in the temporal mask (Tmask). It is recommended that you use the green band and the SWIR band. If no band IDs are provided, no masking will occur.</para>
        /// <para>要在时态掩码 （Tmask） 中使用的频段 ID。建议您使用绿色波段和 SWIR 波段。如果未提供频段 ID，则不会进行屏蔽。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bands for Temporal Masking")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _tmask_bands { get; set; } = null;


        /// <summary>
        /// <para>Chi-squared Threshold for Detecting Changes</para>
        /// <para>The chi-square statistic change probability threshold. If an observation has a calculated change probability that is above this threshold, it is flagged as an anomaly, which is a potential change event. The default value is 0.99.</para>
        /// <para>卡方统计量变化概率阈值。如果观测值的计算变化概率高于此阈值，则将其标记为异常，即潜在的变化事件。默认值为 0.99。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Chi-squared Threshold for Detecting Changes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _chi_squared_threshold { get; set; } = 0.99;


        /// <summary>
        /// <para>Minimum Consecutive Anomaly Observations</para>
        /// <para>The minimum number of consecutive anomaly observations that must occur before an event is considered a change. A pixel must be flagged as an anomaly for the specified number of consecutive time slices before it is considered a true change. The default value is 6.</para>
        /// <para>在事件被视为更改之前必须发生的连续异常观测值的最小数量。像素必须被标记为指定数量的连续时间片的异常，然后才能将其视为真正的更改。默认值为 6。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Consecutive Anomaly Observations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _min_anomaly_observations { get; set; } = 6;


        /// <summary>
        /// <para>Updating Fitting Frequency (in years)</para>
        /// <para>The frequency, in years, at which to update the time series model with new observations. The default value is 1.</para>
        /// <para>使用新观测值更新时间序列模型的频率（以年为单位）。默认值为 1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updating Fitting Frequency (in years)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _update_frequency { get; set; } = 1;


        public AnalyzeChangesUsingCCDC SetEnv(object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}